<template>
  <div class="shop-info">
    <!-- logo -->
    <div class="shop-logo">
      <img :src="shop.shopLogo" alt="" />
      <span>{{ shop.name }}</span>
    </div>
    <!-- 店铺信息 -->
    <div class="shop-list">
      <div class="shop-list-left">
        <div class="shop-item-left">
          <span>
            {{ shop.cSells }}
          </span>
          <span class="shop-item-bottom">总销量</span>
        </div>
        <div class="shop-item-right">
          <span>
            {{ shop.cGoods }}
          </span>
          <span class="shop-item-bottom">全部宝贝</span>
        </div>
      </div>
      <div class="shop-list-right">
        <div v-for="(item,index) in shop.score" :key="index" class="shop-list-right-item">
          <span class="shop-list-right-name">{{ item.name }}</span>
          <span class="shop-list-right-score" :class="{better: !item.isBetter}">{{ item.score }}</span>
          <span v-if="item.score < 5" class="low">低</span>
          <span v-else class="gao">高</span>
        </div>
      </div>
    </div>
    <!-- 进店逛逛 -->
    <div class="shop-bottom">
        进店逛逛
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailShopInfo",
  props: {
    shop: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.shop-logo {
  margin-left: 12px;
}
.shop-logo img {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  vertical-align: middle;
}
.shop-logo span {
  margin-left: 8px;
  font-size: 14px;
}
.shop-list {
  display: flex;
  padding: 0px 20px
}
.shop-list-left {
  display: flex;
  margin-left: 15px;
}
.shop-list-left::after {
  content: "";
  height: 40px;
  width: 1px;
  background-color: #ccc;
  margin-top: 20px;
}
.shop-list-right {
  margin-left: 35px;
  font-size: 14px;
}
.shop-list-right-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.shop-item-left {
  margin-right: 20px;
}
.shop-item-left, .shop-item-right {
  display: flex;
  font-size: 15px;
  text-align: center;
  margin-top: 20px;
  flex-direction: column;
}
.shop-item-right {
  padding-right: 40px;
}
.shop-item-bottom {
  position: relative;
  top: -10px;
  font-size: 13px;
  margin-top: 15px;
}
.shop-list-right-score {
  margin: 0 8px;
  color: green;
}
.better {
  color: red;
}
.low {
  background-color: red;
  padding: 1px;
  color: #fff;
}
.gao {
  background-color: green;
  color: #fff;
}
.shop-bottom {
  margin: 0 auto;
  width: 130px;
  height: 25px;
  background-color: #eee;
  border-radius: 25px;
  text-align: center;
  line-height: 25px;
  font-size: 13px;
  margin-top: 5px;
}
.shop-info {
  border-bottom: 4px solid #eee;
  padding-bottom: 20px;
}
</style>
